package com.vf.admin.client.service.impl;

import com.vf.admin.client.dao.AppHelpServiceDao;
import com.vf.admin.client.service.AppHelpService;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppHelp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author anxiang
 * @version 1.0.0
 * @ClassName AppHelpServiceImpl.java
 * @Description TODO
 * @createTime 2021年07月23日 14:49:00
 */

@Service
public class AppHelpServiceImpl implements AppHelpService {

    @Autowired
    AppHelpServiceDao appHelpServiceDao;

    @Override
    public void saveOrUpdate(AppHelp appHelp) {
        appHelpServiceDao.saveOrUpdate(appHelp);
    }

    @Override
    public List<AppHelp> findList(Map<String, Object> paramap, SplitPageBean splitPageBean) {
        return appHelpServiceDao.findList(paramap, splitPageBean);
    }

    @Override
    public List<AppHelp> findList(Integer type, String title) {
        List<AppHelp> list = appHelpServiceDao.findList(type, title);
        for(AppHelp b : list) {
            b.setTitle(b.getSort() + "." + b.getTitle());
        }
        return list;
    }

    @Override
    public void delete(Integer id) {
        appHelpServiceDao.delete(id);
    }
}